package main

import "fmt"

func f1() int {
	x := 5
	defer func() {
		x++
	}()
	return x
}

func f2() (x int) {
	defer func() {
		x++
	}()
	return 5
}

// fmt.Println(f2())

func ff2() (r int) {
	defer func(r int) {
		r += 5
	}(r)
	return 1
}

func f3() (y int) {
	x := 5
	defer func() {
		x++
	}()
	return x
}
func f4() (x int) {
	defer func(x int) {
		x++
	}(x)
	return 5
}

func fff1() (r int) {
	t := 5
	defer func() {
		t += 5
	}()
	return t
}

func Dmain() {
	fmt.Println(f1())
	fmt.Println(f2())
	fmt.Println(f3())
	fmt.Println(f4())
	fmt.Println(fff1())
	fmt.Println(ff2())
}
